package xjtu.zd.server.staff.comment.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xjtu.zd.server.common.Utils;
import xjtu.zd.server.staff.comment.CommentDto;
import xjtu.zd.server.staff.comment.CommentService;
import xjtu.zd.server.staff.comment.QueryDto;
import xjtu.zd.server.staff.comment.dao.CommentDao;

import javax.annotation.Resource;
import java.util.Map;

@Service
@Transactional
public class CommentServiceImpl implements CommentService {

    @Resource
    CommentDao commentDao;

    @Override
    public Map<String, Object> getCommentReported(QueryDto dto) {
        Map<String, Object> page = Utils.getPage(dto, ()->commentDao.findComment(dto));
        return page;
    }

    @Override
    public void HandleComment(CommentDto dto) {
        commentDao.updComment(dto);
    }
}
